package com.example.demo.ThreadTest;

import java.util.concurrent.TimeUnit;

/**
 * 线程不断休眠
 * @author FF998
 */
public class WaitingTime  implements Runnable{
    @Override
    public void run() {
        while (true){
            waitSecond(200);
        }
    }

    // 线程等待多少秒
    public static final void waitSecond(int seconds) {
        try {
            TimeUnit.SECONDS.sleep(seconds);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
